import 'package:flutter/material.dart';
import 'ConversionItem.dart';
import 'package:weixinclone/bean/ConversionBean.dart';
import 'package:weixinclone/conversion/DeviceInfoItemPage.dart';
import 'package:weixinclone/bean/DeviceBean.dart';

class Conversion extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => ConversionState();
}

class ConversionState extends State<Conversion> {
  List<ConversationBean> _conversionList;

  int get iconName {
    return 0xe75e;
  }

  @override
  void initState() {
    super.initState();
    _conversionList = ConversationPageData.mockConversations;
  }

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemBuilder: (BuildContext context, int index) {
        if (index == 0) {
          return DeviceInfoItemPage(DeviceBean(iconName, "Windows 微信已登录"));
        } else {
          return ConveriosnItem(_conversionList[index - 1]);
        }
      },
      itemCount: _conversionList.length + 1,
    );
  }
}
